<template>
  <el-row class="data-lists">
    <!-- 一 -->
    <el-col :span="9" :class="{ shake: disabled }">
      <div class="data-item-one flx-row">
        <div class="item-left">
          <img src="/src/assets/home.png" alt="" srcset="" />
        </div>
        <div class="item-right">
          <div class="item-right-top">
            <div class="tit">本期活动GMX</div>
            <div class="num">1523.53w</div>
          </div>
          <div class="line"></div>
          <div class="item-right-bottom flx-row">
            <div class="item" v-for="(item, index) in DataList" :key="index">
              <div class="tit">{{ item.name }}</div>
              <div class="num">{{ item.cit }}</div>
            </div>
          </div>
        </div>
      </div>
    </el-col>

    <!-- 二 -->
    <el-col :span="9" :class="{ shake: disabled }"
      ><div class="data-item-two">
        <div class="item">
          <div class="item-des flx-row">
            <img src="/src/assets/icon1.png" alt="" />
            <div class="right">
              <div class="num">934.7w <span>29.74</span></div>
              <div class="txt">今日DAU</div>
            </div>
          </div>
        </div>
        <div class="item">
          <div class="item-des flx-row" style="margin-right: 0px">
            <img src="/src/assets/icon2.png" alt="" />
            <div class="right">
              <div class="num">264.7w <span>29.74</span></div>
              <div class="txt">今日DAU</div>
            </div>
          </div>
        </div>
        <div class="item">
          <div class="item-des flx-row">
            <div class="right border-right-1px">
              <div class="num">24.93w</div>
              <div class="txt">今日DAU</div>
            </div>
            <div class="right">
              <div class="num">984.52w</div>
              <div class="txt">总用户数</div>
            </div>
          </div>
        </div>
        <div class="item">
          <div class="item-des flx-row" style="margin-right: 0px">
            <div class="right border-right-1px">
              <div class="num">84.52w</div>
              <div class="txt">GPS</div>
            </div>
            <div class="right">
              <div class="num">84.52w</div>
              <div class="txt">特权</div>
            </div>
          </div>
        </div>
      </div>
    </el-col>

    <!-- 三 -->
    <el-col :span="6" :class="{ shakeRight: disabled }">
      <div class="data-item-three">
        <div class="tit">待处理</div>
        <div class="content">
          <div class="item" v-for="(item, index) in DataItem" :key="index">
            <div class="item-data">
              <div class="tit">{{ item.name }}</div>
              <div class="num">{{ item.num }} <span>条</span></div>
              <el-icon class="icon"><component :is="item.nmo"></component></el-icon>
            </div>
          </div>
        </div>
      </div>
    </el-col>
  </el-row>

  <el-row class="data-cent">
    <el-col :span="18">
      <div class="flx-row">
        <div class="data-cent-cent">
             <ECharts1></ECharts1>
        </div>
        <div class="data-cent-cent"> 
          <ECharts2></ECharts2>
        </div>
      </div>
      <div class="tab-data">
        <div class="tab-title">主题页列表</div>
        <div class="tab-table">
            <index></index>
        </div>
      </div>
    </el-col>
    <el-col :span="6">
      <div class="data-item-three" :class="{ shakeRight: disabled }">
        <div class="tit">常用功能</div>
        <div class="content">
          <div class="item" v-for="(item, index) in DataMent" :key="index">
            <div class="item-data flx-row">
              <div class="tit">
                <el-icon><component :is="item.icon"></component></el-icon>{{ item.name }}
              </div>
              <el-icon class="icon"><component :is="item.nicon"></component></el-icon>
            </div>
          </div>
         
        </div>
      </div>
      <div class="notice">
        <div class="notice-news">
          <img src="/src/assets/homebg.jpeg" alt="" />
          <div class="txt one-cut-txt">
              不要看我，小丑吧你 ，感觉你像傻叉
          </div>
        </div>
      </div>
      <div class="data-item-three" :class="{ shakeRight: disabled }">
        <div class="tit">公告栏</div>
        <div class="notice-lists">
          <div class="item one-cut-txt" v-for="(item, index) in notList" :key="index">
            <span class="type">通知</span> {{ item.desc }}
          </div>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
import ECharts1 from "@/components/ECharts/model/ECharts1.vue";
import ECharts2 from "@/components/ECharts/model/ECharts2.vue";
// import { ApioneList } from "@/api/server";
import index from "@/components/layout/index.vue";
import { oneList } from "@/mock/Mock";
const disabled = ref(false);

const DataList = [
  {
    name:'类目一',
    cit:'53w'
  },
   {
    name:'类目二',
    cit:'73w'
  },
   {
    name:'类目三',
    cit:'98w'
  },
]

const DataItem = [
  {
    name:'退款申请',
    num:'89',
    nmo:'ArrowRight'
  },
   {
    name:'退款申请',
    num:'89',
    nmo:'ArrowRight'
  },
   {
    name:'退款申请',
    num:'89',
    nmo:'ArrowRight'
  },
   {
    name:'退款申请',
    num:'89',
    nmo:'ArrowRight'
  },
]

const DataMent = [
  {
    name:'订单列表',
    icon:'Histogram',
    nicon:'ArrowRight'
  },
   {
    name:'用户列表',
    icon:'Avatar',
    nicon:'ArrowRight'
  },
   {
    name:'首页配置',
    icon:'HomeFilled',
    nicon:'ArrowRight'
  },
   {
    name:'主题配置',
    icon:'PictureFilled',
    nicon:'ArrowRight'
  },
   {
    name:'活动管理',
    icon:'Menu',
    nicon:'ArrowRight'
  },
   {
    name:'退款申请',
    icon:'Tools',
    nicon:'ArrowRight'
  },
]
const notList = ref([]);
notList.value = oneList.list
console.log(oneList,'12345667890');

// onMounted(()=>{
//    ApioneList('/').then((res)=>{

//    })
//     console.log(res,'njahdbbhdbhbjhbasbj');
// })
</script>

<style scoped lang="scss">
.data-lists {
  width: 100%;

  .el-col {
    height: 100%;
  }
  .data-item-one {
    background: #2969ff;
    margin-right: 10px;
    padding: 10px;
    height: 156px;
    border-radius: 6px;
    color: #fff;

    .item-right {
      padding-left: 20px;
      padding-right: 10px;
      flex: 1;

      .item-right-top {
        margin-bottom: 10px;

        .tit {
          padding-bottom: 5px;
        }
        .num {
          font-size: 24px;
          font-weight: 700;
          text-align: left;
        }
      }
      .line {
        width: 100%;
        height: 2px;
        background-color: #fff;
        opacity: 0.1;
      }
      .item-right-bottom {
        margin-top: 10px;
        .item {
          flex: 1;
          cursor: pointer;
          .tit {
            font-size: 14px;
            padding-bottom: 5px;
            cursor: pointer;
          }
          .num {
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
          }
        }
      }
    }
  }
  .data-item-two {
    height: 176px;
    margin-right: 10px;
    display: flex;
    flex-wrap: wrap;
    cursor: pointer;

    .item {
      height: 50%;
      width: 50%;
      cursor: pointer;

      .item-des {
        margin-right: 8px;
        margin-bottom: 8px;
        background-color: #fff;
        padding: 20px;
        border-radius: 6px;

        &:nth-child(2n) {
          margin-right: 0px;
        }

        .right {
          flex: 1;
          padding-left: 22px;

          .num {
            font-size: 18px;
            font-weight: 700;
            letter-spacing: 0px;
            cursor: pointer;

            span {
              font-size: 12px;
              color: rgba(30, 189, 94, 1);
            }
          }

          .txt {
            padding-top: 8px;
            font-size: 12px;
            font-weight: 400;

            color: rgba(0, 0, 0, 0.3);
          }
        }
      }
    }
  }
  .data-item-three {
    padding: 10px;
    height: 156px;
    margin-bottom: 10px;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;

    .tit {
      font-size: 14px;
      padding-bottom: 5px;
    }

    .content {
      display: flex;
      flex-wrap: wrap;
      cursor: pointer;

      .item {
        width: 50%;
        height: 50%;
        cursor: pointer;

        .item-data {
          margin: 5px;
          opacity: 1;
          padding: 10px;
          border-radius: 6px;
          background: #fafafcff;
          position: relative;

          .icon {
            position: absolute;
            right: 16px;
            top: 40%;
            color: rgba(25, 30, 36, 0.5);
            font-size: 14px;
          }

          .tit {
            font-size: 12px;
            font-weight: 400;
            color: rgba(25, 30, 36, 0.5);
            padding-bottom: 5px;
          }

          .num {
            color: #0052d9;
            font-size: 14px;
            font-weight: 700;

            span {
              color: #666;
              font-weight: 400;
              color: rgba(25, 30, 36, 0.5);
            }
          }
        }
      }
    }
  }
}
// img {
//   width: 100%;
//   object-fit: cover;
// }

.data-cent {
  .data-cent-cent {
    flex: 1;
    height: 260px;
    margin-right: 10px;
    margin-bottom: 10px;
    background-color: #fff;
    border-radius: 6px;
    // cursor: pointer;
  }
  .tab-data {
    border-radius: 6px;
    margin-right: 10px;
    background-color: #fff;
    padding-bottom: 10px;
    .tab-title {
      padding: 10px 10px 0 10px;
      font-size: 14px;
      font-weight: bold;
      letter-spacing: 1px;
    }
    .tab-table {
     margin: 10px;
    }
  }
}

.data-item-three {
  padding: 10px;
  // height: 156px;
  margin-bottom: 10px;
  background-color: #fff;
  border-radius: 6px;

  .tit {
    font-size: 14px;
    padding-bottom: 5px;
  }

  .content {
    display: flex;
    flex-wrap: wrap;

    .item {
      width: 50%;
      height: 50%;
      cursor: pointer;

      .item-data {
        margin: 5px;
        opacity: 1;
        padding: 10px;
        border-radius: 6px;
        background: #fafafcff;
        position: relative;
        align-items: center;

        .icon {
          position: absolute;
          right: 16px;
          top: 40%;
          color: rgba(25, 30, 36, 0.5);
          font-size: 14px;
        }

        .tit {
          font-size: 12px;
          font-weight: 400;
          color: rgba(25, 30, 36, 0.5);
          padding-bottom: 5px;
          display: flex;
          align-items: center;

          .el-icon {
            font-size: 20px;
            color: rgba(25, 30, 36, 0.5);
            margin-right: 5px;
          }
        }
      }
    }
  }
}

 .notice {
    width: 100%;
    height: 152px;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;

    .notice-news {
      width: 100%;
      height: 100%;
      position: relative;

      img {
        width: 100%;
        object-fit: cover;
      }

      .txt {
        position: absolute;
        bottom: 0;
        right: 0;
        left: 0;
        background-color: rgba(0, 0, 0, 0.3);
        font-size: 14px;
        color: #fff;
        padding: 10px;
      }
    }
  }

  .notice-lists {
    height: 260px;
    overflow: scroll;

    .item {
      font-size: 14px;
      padding: 10px;
      color: #666;

      .type {
        font-size: 10px;
        padding: 5px 10px;
        font-weight: 500;
        line-height: 0px;
        color: #fa4a1e;
        text-align: left;
        border-radius: 6px;
        background: #fa4a1e14;

        &.error-type {
          color: #4060c7;
          background: #e8f3ff;
        }
      }
    }
  }
</style>